﻿<Window x:Class="GemGui.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tb="http://www.hardcodet.net/taskbar"
        xmlns:gemGui="clr-namespace:GemGui"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Name="WndMain"
        WindowStyle="ToolWindow"
        Title="MainWindow"
        Height="350" Width="525"
        Icon="Icons/GemAppIcon.ico" ShowInTaskbar="False"
        Closing="Window_Closing" Visibility="Hidden" Activated="WndMain_Activated">
  
  <Grid>
    <tb:TaskbarIcon
      DataContext="{Binding ViewModel}"
      Name="TbiNotificationIcon"
      IconSource="/Icons/GemAppIcon.ico"
      ToolTipText="{Binding SccSummary}"
      DoubleClickCommand="{Binding OwnerWindow.ConfigureAppCommand}">
      
      <tb:TaskbarIcon.TrayToolTip>
        <Border
          Background="White"
          BorderBrush="Orange"
          BorderThickness="2"
          CornerRadius="4"
          Opacity="0.9">
          
          <TextBlock
            Text="{Binding SccSummary}"
            Margin="4" />
        </Border>
      </tb:TaskbarIcon.TrayToolTip>

      <tb:TaskbarIcon.TrayPopup>
        <Border
          Background="White"
          BorderBrush="Chocolate"
          BorderThickness="2"
          CornerRadius="4">
            <gemGui:SccEnvironmentsControl
              DataContext="{Binding SccEnvironmentsModel}"
              HorizontalAlignment="Center"
              VerticalAlignment="Center" />
        </Border>
      </tb:TaskbarIcon.TrayPopup>

      <tb:TaskbarIcon.ContextMenu>
        <ContextMenu>
          <MenuItem
            Header="Configure"
            FontWeight="Bold"
            Command="{Binding OwnerWindow.ConfigureAppCommand}" />
          <MenuItem
            Header="Refresh Folders Structure"
            Command="{Binding OwnerWindow.RefreshCommand}" />
          <Separator />
          <MenuItem
            Header="Open Latest Log"
            Command="{Binding OwnerWindow.LogViewingCommand}" />
          <MenuItem
            Header="About"
            Command="{Binding OwnerWindow.AboutWindowCommand}" />
          <MenuItem
            Header="Exit"
            Command="{Binding OwnerWindow.ExitApplicationCommand}" />
        </ContextMenu>
      </tb:TaskbarIcon.ContextMenu>
    </tb:TaskbarIcon>
  </Grid>
</Window>
